﻿//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1998-2024 Glodon Company Limited.
//
// Licensed under the MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the “Software”),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "ComponentEditorGnufUI.h"
#include "TranslatorManager.h"

constexpr unsigned int TREE_USER_DATA_ROLE = 0x0100;
constexpr unsigned int Gnuf_FAMILY_USER_DATA_ROLE = TREE_USER_DATA_ROLE + 100;
constexpr unsigned int Gnuf_MODEL_VIEW_USER_DATA_ROLE = TREE_USER_DATA_ROLE + 101;
constexpr unsigned int Gnuf_VIEWPORT_USER_DATA_ROLE = TREE_USER_DATA_ROLE + 103;
constexpr unsigned int Gnuf_IMPORT_ITEM_FAMILY_TYPE = TREE_USER_DATA_ROLE + 1;
constexpr unsigned int Gnuf_PAPER_USER_DATA_ROLE = TREE_USER_DATA_ROLE + 102;
constexpr unsigned int Gnuf_DETAILVIEW_USER_DATA_ROLE = TREE_USER_DATA_ROLE + 106;
constexpr unsigned int Gnuf_DRAWINGLAYOUT_USER_DATA_ROLE = TREE_USER_DATA_ROLE + 105;
constexpr unsigned int Gnuf_DETAILLIST_USER_DATA_ROLE = TREE_USER_DATA_ROLE + 104;
constexpr unsigned int Gnuf_CAD_SHEET_ITEM_FAMILY_TYPE = TREE_USER_DATA_ROLE + 1;
constexpr unsigned int Gnuf_AREA_VIEW_GROUP_USER_DATA_ROLE = TREE_USER_DATA_ROLE + 200;
constexpr unsigned int Gnuf_ELEVATION_MODEL_VIEW_USER_DATA_ROLE = TREE_USER_DATA_ROLE + 107;

#define PlanViewType       L"PlanViewType"      // 平面视图
#define ElevationViewType  L"ElevationViewType" // 立面视图
#define SectionViewType    L"SectionViewType"   // 剖面视图
#define View3DViewType     L"View3DViewType"    // 三维视图
#define CeilingViewType    L"CeilingViewType"   // 天花板视图
// 增加视图类型时，需在GetModelViewTypeName中提供视图类型名称

namespace gfam
{
    class GnufModelViewTypeUtil
    {
    public:
        static std::wstring GetModelViewTypeName(const std::wstring& viewType)
        {
            std::wstring viewTypeName;
            if (viewType == PlanViewType)
            {
                viewTypeName = GBMP_TR(L"平面视图");
            }
            else if (viewType == CeilingViewType)
            {
                viewTypeName = GBMP_TR(L"天花板平面视图");
            }
            else if (viewType == SectionViewType)
            {
                viewTypeName = GBMP_TR(L"剖面视图");
            }
            else if (viewType == ElevationViewType)
            {
                viewTypeName = GBMP_TR(L"立面视图");
            }
            else if (viewType == View3DViewType)
            {
                viewTypeName = GBMP_TR(L"三维视图");
            }
            else
            {
                viewTypeName = L"未知视图类型";
            }

            return viewTypeName;
        }
    };
}
